home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 12 / 012.d81 / comal #4 < prev    next >
Text File  |  2022-08-26  |  3KB  |  152 lines

  1.  
  2. COMAL corner-Part 4    by Jimmy Weiler
  3.  
  4.    THE COMAL 0.14 OPERATING SYSTEM
  5.  
  6.  - - - - - - - - - - - - - - - - - -
  7. PART THE SECOND: GETTING SOPHISTICATED
  8.  WITH DISK STORAGE.
  9.  - - - - - - - - - - - - - - - - - -
  10.  
  11. Command: 'CHAIN'
  12.  
  13.   In BASIC, you can't easily LOAD and
  14.  
  15. RUN a program in one step, especially
  16.  
  17. from within another program.
  18.  
  19.   In COMAL, the CHAIN command does the
  20.  
  21. job.
  22.  
  23.   To LOAD and RUN "MY PROGRAM", enter
  24.  
  25. CHAIN "MY PROGRAM".
  26.  
  27.   To make one program run another, all
  28.  
  29. you have to do is place a CHAIN
  30.  
  31. command inside the first program:
  32.  
  33. 100 PRINT "HELLO"
  34. 300 CHAIN "PART 2"
  35.  
  36.   This will print "HELLO" on the
  37.  
  38. screen and then run a program called
  39.  
  40. "PART 2".  If this program were saved
  41.  
  42. as "PART 2", it would continually
  43.  
  44. rerun itself.
  45.  
  46.  - - - - - - - - - - - - - - - - - -
  47.  
  48. Command: 'LIST "name"'
  49.  
  50.   LOAD and CHAIN work only with
  51.  
  52. programs that have been SAVEd, which
  53.  
  54. brings us to the other way to put a
  55.  
  56. program on disk -- LIST.   Don't get
  57.  
  58. confused here...  LIST all by itself,
  59.  
  60. or with a range of numbers will list
  61.  
  62. the program in memory to the screen.
  63.  
  64.   LIST followed by a name in quotes
  65.  
  66. will create a SEQ file containing the
  67.  
  68. image of the program in memory.
  69.  
  70. Example:
  71. LIST "MY PROGRAM.L"
  72.  
  73. If you give all your LISTed programs
  74.  
  75. the suffix ".L", you will be able to
  76.  
  77. recognize them at a glance.
  78.  
  79.  - - - - - - - - - - - - - - - - - -
  80.  
  81. Command: 'ENTER'
  82.  
  83.   To reload a program that has been
  84.  
  85. LISTed to disk, you use the ENTER
  86.  
  87. command:
  88.  
  89. ENTER "MY PROGRAM.L"
  90.  
  91.  - - - - - - - - - - - - - - - - - -
  92.  
  93. 'WHY USE LIST & ENTER'
  94.  
  95.   If ENTER and LIST were nothing more
  96.  
  97. than another way to LOAD and SAVE they
  98.  
  99. wouldn't be much use.  Well, it turns
  100.  
  101. out that there are significant
  102.  
  103. differences.
  104.  
  105.   LOAD erases whatever was in memory
  106.  
  107. before it reads a file from the disk.
  108.  
  109. ENTER doesn't.  ENTER merges the disk
  110.  
  111. file with the program in memory. This
  112.  
  113. fact lets you build a library of
  114.  
  115. procedures to merge into your programs
  116.  
  117. as you need them.
  118.  
  119.   The other advantage of ENTER is that
  120.  
  121. it allows you to transport COMAL
  122.  
  123. programs from COMAL 0.14, the disk
  124.  
  125. version, to COMAL 2.0, the vastly
  126.  
  127. superior cartridge version.
  128.  
  129.  - - - - - - - - - - - - - - - - - -
  130.  
  131. Command: 'DELETE'
  132.  
  133.   Eventually, your disks fill up and
  134.  
  135. it's time to remove some files.  In
  136.  
  137. BASIC, we use the SCRATCH command.  In
  138.  
  139. COMAL, it's DELETE.  If we want to
  140.  
  141. delete that little program we've been
  142.  
  143. working with, we just type
  144.  
  145. DELETE"0:YOUR PROGRAM".
  146.  
  147. Do NOT omit the "0".  COMAL 0.14
  148.  
  149. needs it -- it refers to drive zero...
  150.  
  151.  - - - - - - - - - - - - - - - - - -
  152.